//
//  CLEncoder.h
//  togetherLBS
//
//  Created by Phyllis Hu on 13-6-1.
//  Copyright (c) 2013年 celi. All rights reserved.
//

#import <Foundation/Foundation.h>

#define V1 0
#define V2 1

// 授权ID
#define XJ_UUID   (@"54b4c01f-dce0-102a-a4e0-462c07a00c5e")
// 向左移位进行加密数据
#define CLCharBlur(i, bit) ((((i&0x00ff)<<bit)&0x00ff) | ((i&0x00ff)>>(8-bit)));
// 对byte数据进行取模运算
#define CLMod8Bit(i)       (i-(((i&0x00ff)>>3)<<3))

@interface CLEncoder : NSObject

//+(NSMutableString *)encode:(NSInteger)nId byVersion:(NSInteger)version;
//+(NSInteger)decode:(NSString *)value byVersion:(NSInteger)version;

+(NSString *)encodeLon:(double)lon byVersion:(NSInteger)version;
+(NSString *)encodeLat:(double)lat byVersion:(NSInteger)version;

/**
 *  ASC加密
 */
+ (NSString *)ASCEncode:(NSString *)str;
+ (NSString *)ASCDecode:(NSString *)str;

/**
 *  对网络请求的参数字符串加密
 */
+ (NSData *)encodeWithString:(NSString *)string;

/**
 *  对字符串进行MD5加密
 */
+ (NSString *)MD5String:(NSString *)str;
@end
